package com.wondersgroup.fjzlpt.console.controller.view.role;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.alibaba.fastjson.JSONObject;
import com.quick.framework.boot.web.utils.RequestUtils;
import com.wondersgroup.fjzlpt.console.constant.RoleScope;
import com.wondersgroup.fjzlpt.console.service.inter.role.RoleService;

@Controller
@RequestMapping("role")
public class RoleController {
	@Autowired
	private RoleService roleService;
	
	@RequestMapping("/index.html")
	public String index_role(HttpServletRequest request) {
		request.setAttribute("roleScope", RoleScope.getAllJsonObject());
		return "role/index";
	}

	@RequestMapping("/manager.html")
	public String manager_role(HttpServletRequest request) {
		Map map = RequestUtils.GetParameterMap(request);
		JSONObject data = roleService.queryInitData(map);
		request.setAttribute("data", data);
		return "role/manager";
	}
	
}
